package example.runner3;
import service.network.NetworkManageService;
import materials.network.AbstractNetworkCreation;
import materials.network.NetworkCreation;
import materials.network.NetworkInterface;
import materials.network.NeuronalNetwork;
import materials.neurons.Neurons;

/**
 * Nur zum Netze erstellen gedacht.
 * 
 * @author Ramox
 * 
 */
public class RunnerNetz extends AbstractNetworkCreation
{
	
	
	public RunnerNetz(){
		createNet();
	}
	/**
	 * erstellt ein neues zufälliges Netz
	 * 
	 * die Neuronen sind so eingeteilt:
	 * 25-25-8
	 * mit sigmoid funktionen
	 * 
	 * @return neues Netz
	 */
	private void createNet()
	{
		NetworkInterface n = new NeuronalNetwork();

		NetworkManageService nms = new NetworkManageService(n);

		nms.raiseLayer();
		nms.raiseLayer();
		nms.raiseLayer();
		
		for (int i = 1; i < 34; i++)
		{
			nms.addNeuronToNetwork(1, "a"+i, Neurons.Linear);
		}

		for (int i = 34; i < 80; i++)
		{
			nms.addNeuronToNetwork(2, "a"+i, Neurons.Sigmoid);
		}
		
		for (int i = 80; i < 88; i++)
		{
			nms.addNeuronToNetwork(3, "a"+i, Neurons.Sigmoid);
		}


		for (int i = 1; i < 34; i++)
		{
			for (int j = 34; j < 80; j++)
			{
				nms.connectTwoNeurons(1 ,"a"+i, "a"+j);
				nms.setWeightOfTwoNeurons(1 ,"a"+i, "a"+j, 0);
			}
		}

		for (int i = 34; i < 80; i++)
		{
			for (int j = 80 ; j < 88; j++)
			{
				nms.connectTwoNeurons(2 ,"a"+i, "a"+j);
				nms.setWeightOfTwoNeurons(2 ,"a"+i, "a"+j, 0);
			}
		}
		
		addNet(n);
	}
}
